public interface BatchItemProcessor<I, O> extends ItemProcessor<I, O> {
    
    @Override
    default O process(I item) throws Exception {
        O converted = doConvert(item);
        if (converted == null) {
            return null;
        }

        ValidationResult result = doValidate(converted);
        if (!result.isValid()) {
            handleValidationError(result);
            return null;
        }

        return converted;
    }

    O doConvert(I item);
    
    ValidationResult doValidate(O item);
    
    default void handleValidationError(ValidationResult result) {
        log.error("Validation failed: {}", result.getErrors());
    }
} 